package models

// MaOrderPoints [...]
type MaOrderPoints struct {
	ID         string  `gorm:"primaryKey;column:id;type:varchar(20);not null;comment:id"  json:"id" json_old:"ID"`
	SalesID    string  `gorm:"index:SalesID;column:sales_id;type:varchar(50);not null" json:"sales_id" json_old:"SalesID"`
	OutTradeNo string  `gorm:"index:OutTradeNo;column:out_trade_no;type:varchar(50);not null"  json:"out_trade_no" json_old:"OutTradeNo"`
	OpenID     string  `gorm:"column:open_id;type:varchar(128);not null;comment:微信唯一标识" json:"open_id" json_old:"OpenID"`
	Type       int     `gorm:"column:type;type:tinyint(1);default:1;comment:类型,1消费2回正" json:"type" json_old:"Type"`
	PointsID   string  `gorm:"column:points_id;type:int;not null;default:1;comment:积分ID 1正弘" json:"points_id" json_old:"PointsID"`
	Points     float64 `gorm:"column:points;type:decimal(10,2);not null;default:0.00;comment:积分" json:"points" json_old:"Points"`
	CreatedAt  int64   `gorm:"index:created_at;column:created_at;autoCreateTime;type:int;size:64;comment:创建时间" json:"created_at" json_old:"CreatedAt"`
	UpdatedAt  int64   `gorm:"column:updated_at;autoUpdateTime;type:int;size:64;comment:更新时间" json:"updated_at" json_old:"UpdatedAt"`
}

// TableName get sql table name.获取数据库表名
func (m MaOrderPoints) TableName() string {
	return "ma_order_points"
}

// 模式自动注册
func init() {
	Models = append(Models, &MaOrderPoints{})
}
